###readme.txt

This folder contains the replication files for Enos, Ryan D. and Noam Gidron. "Intergroup Behavioral Strategies as Contextually Determined: Experimental Evidence from Israel," The Journal of Politics.

***To replicate this manuscript*** 
run "EnosGidronReplication.r" by typing "source('EnosGidronReplication.r')" into the R terminal.  This will use pre-processed data to output all figures, tables, and other tests in the manuscript and appendix.

**Note** Executing this script will produce three warning messages.  These result from an internal function call and do not affect the validity of the output.

**Output is in a the directory "output," and should be sixteen figures and two tables.  Twelve of these figures are included in Figure 2 in the manuscript and two figures are included in Figure 4 in the manuscript. The directory also includes a subdirectory "Appendix," into which the script outputs the Tables and Figures in the Appendix. This will contain thirty-nine tables and one figure, which are the complete set of Figures and Tables in the Online Appendix that were not created by hand.
	
**Prior to executing the scripts, the R terminal should be pointed to the folder "EnosGidronReplication", which can be accomplished by typing "setwd('../EnosGidronReplication')" where ".." is the local file structure where "EnosGidronReplication" is located.

These files require the R programming language, which can be downloaded here: http://www.r-project.org/

You execute EnosGidronReplication.r, you may need to install the packages used, this can be accomplished by typing the following in the R terminal:
install.packages("sandwich")
install.packages("lmtest")
install.packages("RColorBrewer")
install.packages("apsrtable")
install.packages("Zelig")
install.packages("xtable")
install.packages("stargazer")
install.packages("Matrix")

Questions? Please contact Ryan Enos (renos@gov.harvard.edu).

**************************************************************
***There is one .Rdata objects included in the directory.  Descriptions of the data frame objects and the variables are below.   

***dat file***
dat: The data include the following variables from observational and experimental data collected by the researchers on July-August 2013:
	“userID”: unique identification number for each participant.
	“uo.non.uo”: respondent is UO or STR.
	“ingroup.public”: decision in public good games with ingroup.
	“outgroup.public”: decision in public good games with outgroup.
	“public.ingroup.preference: respondent cooperated in public good games with ingroup but not with outgroup. 1/0
	“in.out.diff.dictator”: difference between money given to ingroup and outgroup in dictator game.
	“ingroup.task”: when asked to complete a LEGO task in a limited time, respondent chose to work with an ingroup.
	“outgroup.task”: when asked to complete a LEGO task in a limited time, respondent chose to work with an outgroup.
	“outgroup.dissim.yeshiva”: segregation scores by yeshiva students, based on census data.
	“outgroup.yeshiva”: share of outgroup measured by yeshiva students, based on census data.
	“demo1.sex”: respondents’ gender.
	“demo1.age”: respondents’ age.
	“demo1.ethnicity”: respondents’ ethnicity (Ashkenazi, Mizrahi\Sephardi, Mixed, Other).
	“demo2.left_right”: respondents’ location on a 7-point left-right scale of political ideology.
	“index.city”: names of cities and neighborhoods in Jerusalem where respondents live.
	“nonjewish_pcnt”: percent of non-Jewish population, based on census data
	“income”: respondents’ income is self-Described as low, average or high compared to average income.
	“college”: respondents holds an undergraduate or graduate degree.
	“immigrant”: respondent was born outside of Israel 0/1
	“jerusalem”: dummy for Jerusalem. 0/1 
	“ingroup.neighborhood.prefer.pref”: would you prefer to live in neighborhood with in-group? 0/1
	“satisfaction.index.high”: satisfaction with respondents’ neighborhood is higher than the median.
	“free.to.move”: Is the respondent constrained in choosing where to live? 1/0
	“low.income”: respondent’s income identified as very low or low compared to the average income. 0/1
	“move.religious.city”: in thinking about the city in which they live, the religiosity of other people  was important for respondents in choosing to live there. 0/1
	“move.religious.nbhood”: thinking about the neighborhood in which they live, the religiosity of other people  was important for respondents in choosing to live there. 0/1
	“selectors”: respondents who selected into more homogeneous environments, based on their previous and current residence.
	“outgroup.houses.exclude”: in designing the ideal neighborhood, no houses assigned for outgroup.

*dat.uo: same variables as dat for UO respondents
*dat.non.uo: same variables as dat for STR respondents

* obs.dat.uo: includes the following variables for UO respondents from the Guttman-Avichai 2009 survey.
	"city”: city name
	"q63”:  how would you describe the relationship between religious and non-religious individuals? Very good \ good \ not so good \ not good at all.
	"q150”: respondents’ gender.
	"q73”: How would you define yourself religious? UO \ religious \ traditional \ secular \ anti-religion
	"q173”:respondents’ income is much higher than average \ higher than average \ average \ lower than average \ much lower than average
	"q166”: respondent has a college degree. 0/1
	"dissimyesh”: segregation scores based on UO share by yeshiva students, based on census
	"homogyesh”: share of UO population by yeshiva students, based on census
	"code”: city code number
	"nonjewish_pcnt”: share of non-Jewish population, based on census
	“jer”: a dummy variable for Jerusalem

*obs.dat.non.uo,: same as obs.da.uo but for non-UO respondents
*obs.dat.secular: same as obs.da.uo but for secular and anti-religious respondents

*des.dat: The data include the following variables from observational and experimental data collected by the researchers on July-August 2013
	“demo1.sex”: respondents’ gender
	“demo3.education”: respondents’ level of education
	“demo1.ethnicity”: respondents’ ethnicity
	“demo2.income_qual”: respondents’ level of income
	“demo1.age”: respondents’ age
	“demo2.left_right”: respondents’ location on a 7-point left-right scale of political ideology.
	“demo1.country”: country where respondents was born
	“uo.non.uo”: whether respondent is UO.
*des.uo: same as des.dat but for UO respondents
*des.non.uo: same as des.dat but for STR

*des.dat.g: The data include the following variables from the Guttman-Avichai 2009 survey:
	“Q151”: respondents’ age
	“Q182”: respondents’ location on a 7-point-scale left-right scale
	“Q150”: respondents’ gender
	“Q173”: respondents’ income is much higher than average \ higher than average \ average \ lower than average \ much lower 
	“Q166”: respondent has a college degree. 0/1
	“Q162”: respondents’ ethnicity (Ashkenazi, Mizrahi\Sephardi, Mixed, Other)
	“Q152”: country where respondent was born